<?php
/**
 * Create by 11li
 * Date 2020/1/16
 * Time 9:37
 *
 */

namespace app\common\service;


use app\common\model\AgentSendTips;
use app\common\model\AgentShop;
use app\common\model\ShipOrder;
use think\Db;

class ShipOrderService extends Server {
	
	/**
	 * 获取代理待签收数量
	 * @param $agentId
	 * @return int|string
	 * @throws \think\Exception
	 */
	public static function getWaitSignNumberByAgentId($agentId) {
		return Db::name('shipOrder')
			->where(['sign_agent_id' => $agentId, 'status' => ShipOrder::STATUS_WAIT])
			->count();
	}
	
	
	/**
	 * 待发货提醒数量
	 * @param $userId
	 * @return int|string
	 * @throws \think\Exception
	 */
	public static function getSendTipsNumberByAgentId($userId)
	{
		return Db::name('agentSendTips')
			->where(['user_id' => $userId, 'status' => AgentSendTips::STATUS_WAIT])
			->count();
	}
	
}